package mrms.api.web.authentication;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;

/**
 * @author lenchu
 * @date 2019/02/03
 */
public interface Authentication {

    /**
     * 登录认证 成功后把用户信息放到request的user属性中
     * 请求体可以从requestBody中获取
     * 有异常不能抛, 放到requestBody的errors:List<Exception>属性中
     * @param request
     * @param response
     * @param requestBody
     */
    void authenticate(HttpServletRequest request,
                      HttpServletResponse response,
                      Map<String, Object> requestBody);
}
